<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
 <title>Metronic | User Login 1</title>
 <meta http-equiv="X-UA-Compatible" content="IE=edge">
 <meta content="width=device-width, initial-scale=1" name="viewport" />
 <meta content="" name="description" />
 <meta content="" name="author" />
 <!-- BEGIN GLOBAL MANDATORY STYLES -->
 <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/plugins/bootstrap/css/bootstrap.css" type="text/css" >
 <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/plugins/font-awesome/css/font-awesome.css" type="text/css" > 
 <link    href="${pageContext.request.contextPath}/assets/css/components.min.css" rel="stylesheet" id="style_components" type="text/css" />
 <link   href="${pageContext.request.contextPath}/assets/css/plugins.min.css" rel="stylesheet" type="text/css" />
 <link   href="${pageContext.request.contextPath}/assets/css/portal.login.min.css" rel="stylesheet" type="text/css" />
 <link   href="${pageContext.request.contextPath}/assets/plugins/bootstrap-datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css" />
 <link   href="${pageContext.request.contextPath}/assets/plugins/layer/skin/default/layer.css" rel="stylesheet" type="text/css" />
 <link rel="shortcut icon" href="favicon.ico" />
 
 <style type="text/css">
   .logo{
      color:#fff;
      font-size:16px;
      font-weight:600;
   }
   
	.login .content .forget-form, .login .content .register-form{
	   display:block;
	}   
	.col{
	   padding-left:0;
	   padding-right:0;
	}
    @media (min-width: 800px){
         .login .content{
            width:700px;
         }
    }
  @media(max-width: 480px){
     #header .btn-group.pull-right, .btn.pull-right{
        margin:0 !important;
     }
  }
  @media(min-width: 800px){
     .login .content{
        width:420px;
     }
  }
 </style>
 
 
</head>
    <body class=" login">
        <!-- BEGIN LOGO -->
        <div class="logo">
           		蚌埠医学院第一附属医院
        </div>
        <!-- END LOGO -->
        <!-- BEGIN LOGIN -->
        <div class="content">
            <!-- END FORGOT PASSWORD FORM -->
            <!-- BEGIN REGISTRATION FORM -->
            <h3 class="font-green">注册</h3>  
               <div class="col-sm-12">
                    <p class="hint"> 手机号码： </p>
	                <div class="form-group">
	                    <input class="form-control" type="text"  id="phone_number" name="phone_number" />
	                </div>                  
               </div>   
<!--                <div class="col-sm-6 ">
                    <p class="hint">姓名：</p>
	                <div class="form-group">
	                    <input class="form-control" type="text" placeholder="密码" id="username" name=""username"" />
	                </div>                  
               </div> -->
               <div class="col-sm-12 ">
                    <p class="hint">密码：</p>
	                <div class="form-group">
	                    <input class="form-control" type="password" id="password" name="password" />
	                </div>                  
               </div>
               <div class="col-sm-12">
                   <p class="hint">密码确认： </p>
	                <div class="form-group">	                    
	                    <input class="form-control" type="password" id="repeat-password" name="repeat-password" /> 
	                </div>               
               </div>               
               <!-- <div class="col-sm-6">
                    <p class="hint"> 身份证号： </p>
	                <div class="form-group">
	                    <input class="form-control" type="text" placeholder="32145789545214521" id="id_number" name="id_number" /> 
	                </div>               
               </div>
               <div class="col-sm-6">
                   <p class="hint">性别： </p>
                    <select id="user_sex" name="user_sex" class="form-control">
                        <option value="1">男</option>
                        <option value="2">女</option>
                    </select>                
               </div>               
               <div class="col-sm-6">
                   <p class="hint">婚姻状态： </p>
                    <select id="user_single" name="user_single" class="form-control">
                        <option value="2">单身</option>
                        <option value="1">已婚</option>
                    </select>                
               </div>
               <div class="col-sm-6">
                    <p class="hint"> 身高(cm)： </p>
	                <div class="form-group">
	                    <input class="form-control" type="text" placeholder="180" id="user_height" name="user_height" /> 
	                </div>               
               </div>
               <div class="col-sm-6 ">
                    <p class="hint">体重(kg)： </p>
	                <div class="form-group">
	                    <input class="form-control placeholder-no-fix" type="text" placeholder="50" id="user_weight" name="user_weight" />
	                </div>                  
               </div>  
               <div class="col-sm-6">
                    <p class="hint">省份： </p>
                    <select id="user_province" name="user_province" class="form-control">
                        <option value="安徽">安徽</option>
                        <option value="AF">上海</option>
                        <option value="AL">北京</option>
                    </select>               
               </div>                             
               <div class="col-sm-6 ">
                    <p class="hint">城市： </p>
                    <select id="user_city" name="user_city" class="form-control">
                        <option value="蚌埠">蚌埠</option>
                        <option value="AF">合肥</option>
                    </select>                 
               </div>               
               <div class="col-sm-6 ">
                    <p class="hint">详细地址 </p>
	                <div class="form-group">
	                    ie8, ie9 does not support html5 placeholder, so we just show field title for that
	                    <label class="control-label visible-ie8 visible-ie9">详细地址</label>
	                    <input class="form-control placeholder-no-fix" type="text" placeholder="安徽省蚌埠市龙子湖区淮海大道196号" id="user_address" name="user_address" />
	                </div>                   
               </div> 
               <div class="col-sm-6 ">
                    <p class="hint">出生日期： </p>
	                <div class="form-group">
	                    ie8, ie9 does not support html5 placeholder, so we just show field title for that
	                    <label class="control-label visible-ie8 visible-ie9"> 出生日期</label>
	                    <input class="form-control placeholder-no-fix" type="text" id="user_birth" placeholder="1997-10-23" name="user_birth" />
	                </div>                  
               </div>  -->                                
                                       
                <div class="form-actions">
                    <button type="button" id="register-back-btn" class="btn green btn-outline">返回</button>
                    <button type="submit" id="register-submit-btn" class="btn btn-success uppercase pull-right">提交</button>
                </div>                             
            <!-- END REGISTRATION FORM -->
        </div>
        <div class="copyright"> 2017bengbu medical collage </div>

        <!--[if lt IE 9]>
<script src="../assets/global/plugins/respond.min.js"></script>
<script src="../assets/global/plugins/excanvas.min.js"></script> 
<![endif]-->
  <script src="${pageContext.request.contextPath}/assets/js/jquery-1.11.2.min.js" charset="utf-8" type="text/javascript"></script>
  <script src="${pageContext.request.contextPath}/assets/plugins/bootstrap/js/bootstrap.min.js"></script>
  <script src="${pageContext.request.contextPath}/assets/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js"></script>
  <script src="${pageContext.request.contextPath}/assets/js/jquery.blockui.min.js"></script>
  <script src="${pageContext.request.contextPath}/assets/plugins/jquery-validation/js/jquery.validate.min.js"></script>
  <script src="${pageContext.request.contextPath}/assets/plugins/jquery-validation/js/additional-methods.min.js"></script>
  <script src="${pageContext.request.contextPath}/assets/plugins/select2/js/select2.full.min.js"></script>
  <script src="${pageContext.request.contextPath}/assets/js/app.min.js"></script>
  <script src="${pageContext.request.contextPath}/assets/js/portal.login.js"></script>
  <script src="${pageContext.request.contextPath}/assets/plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"></script>
  <script src="${pageContext.request.contextPath}/assets/plugins//layer/mobile/layer.js"></script>
    <script src="${pageContext.request.contextPath}/assets/plugins/layer/layer.js"></script>
  
    <script type="text/javascript">
     var page={
    		 init:function(){    			     			  			 
    			 this.initEvents().initBirthDatePick();    			 
    		 },
    		 initEvents:function(){
    			 var that = this;    			 
    			 //跳转到注册页面
    			 $("#register-back-btn").on("click",function(){
    				 window.history.go(-1);
    			 })
    			 //提交注册
    			 $("#register-submit-btn").on("click",function(){
    				 
    				 
    				 //CODE,NAME,SEX,PHONE_NUMBER,MARRIAGE,ID_NUMBER,BIRTHDAY,HEIGHT,WEIGHT,PROVINCE,
                     //CITY,AREA,ADDRESS,PASSWORD,CREATE_DATE
    				 
/*     				 var params = {};    				
     				 params.NAME = $("#username").val();
    				 params.PASSWORD = $("#password").val();
    				 params.ID_NUMBER = $("#id_number").val();
    				 params.SEX=$("#user_sex").val();
    				 params.PHONE_NUMBER = $("#phone_number").val();
    				 params.HEIGHT = $("#user_height").val();
    				 params.WEIGHT = $("#user_weight").val();
    				 params.PROVINCE = $("#user_province").val();
    				 params.CITY = $("#user_city").val();
    				 params.ADDRESS = $("#user_address").val();
    				 params.MARRIAGE = $("#user_single").val();
    				 params.BIRTHDAY = $("#user_birth").val(); */
    				 
    			/* 	 
	   				  if($.trim(params.NAME)==""){    
	   					layer.msg("对不起，姓名不能为空!");//请将“字符串类型”要换成你要验证的那个属性名称！    
	   					return false
	   				 } 
    				 var  regpassword=/^[a-zA-Z0-9_]+$/; 
	   				 if(!regpassword.test(params.PASSWORD) || $.trim(params.PASSWORD)==""){    
	   					layer.msg("对不起，请输入正确的密码!");//请将“字符串类型”要换成你要验证的那个属性名称！
	   					return false
	   				 } 
    				 var  regid_number=/^\d{15}|\d{18}$/; 
	   				 if(!regid_number.test(params.ID_NUMBER) || $.trim(params.ID_NUMBER)==""){    
	   					layer.msg("对不起，请输入正确的身份证号!");//请将“字符串类型”要换成你要验证的那个属性名称！
	   					return false
	   				 } 
    				 var  reguser_height=/^[0-9]*$/; 
	   				 if(!reguser_height.test(params.HEIGHT) || $.trim(params.HEIGHT)==""){    
	   					layer.msg("对不起，请输入身高!");//请将“字符串类型”要换成你要验证的那个属性名称！
	   					return false
	   				 } 
    				 var  reguser_height=/^[0-9]*$/; 
	   				 if(!reguser_height.test(params.WEIGHT) || $.trim(params.WEIGHT)==""){    
	   					layer.msg("对不起，请输入体重!");//请将“字符串类型”要换成你要验证的那个属性名称！
	   					return false
	   				 } 	  */	
	   				 
	   				 
	   			   	 var params = {};    				     				 
     				 params.PHONE_NUMBER = $("#phone_number").val();
    				 params.PASSWORD = $("#password").val();
    				 params.REPEAT_PASSWORD = $("#repeat-password").val();  
    				 if(params.PASSWORD!=params.REPEAT_PASSWORD){
    					 layer.msg("密码输入有误：请重新输入");
    					 return false;
    				 }
    				 var  regpassword=/^[a-zA-Z0-9_]+$/; 
	   				 if(!regpassword.test(params.PASSWORD) || $.trim(params.PASSWORD)==""){    
	   					layer.msg("对不起，请输入正确的密码!");//请将“字符串类型”要换成你要验证的那个属性名称！
	   					return false
	   				 }
	   				if(!(/^1[3|4|5|8][0-9]\d{4,8}$/.test(params.PHONE_NUMBER))){
	   					layer.msg("对不起，请输入正确的手机号码!");
	   					return false;
	   				}    				 
    				 
        			 $.post("${pageContext.request.contextPath}/Portal/portal/REG01.do?rnd="+Math.random(),params,function(result){
        				 if(result.state==1){
        					 window.location.href="${pageContext.request.contextPath}/Portal/portalIndex.do?rnd="+Math.random();
        				 } else {
        					 layer.msg(result.msg);
        					 return false;
        				 }        				 
        			 })
        			 return false;
    			 })    			 
    			 return that;
    		 },
    		 initBirthDatePick:function(){
    			 var that = this;
                 $('#user_birth').datetimepicker({
                     format: 'yyyy-mm-dd',
                     weekStart: 1,
                     autoclose: true,
                     todayBtn:  1, 
                     startView: 2,
                     todayHighlight: 1,
                     showMeridian: 1,
                     minView: 3,
                     forceParse: false,
                     language: 'zh'
                 });      			 
    			 return that;
    		 },
    		// 登录密码  
    		 checkpassword:function() {  
    		     var password = document.form1.password.value;  
    		     if (password.length < 6 || password.length > 30) {  
    		         ///document.getElementById("passwordTip").innerHTML = "<font color='red'>× 密码长度不能小于6位，大于30位</font>";  
    		         return false;  
    		     } else if (!isNaN(password)) {  
    		         //document.getElementById("passwordTip").innerHTML = "<font color='red'>× 密码不能全是数字</font>";  
    		         return false;  
    		     } else {  
    		        // document.getElementById("passwordTip").innerHTML = "<font color='#339933'>√ 密码合格</font>";  
    		         return true;  
    		     }  
    		 },
    		// 证件号码  
    		 checkjbCredentialsCode:function () {  
    		     var jbCredentialsCode = document.form1.jbCredentialsCode.value;  
    		     var reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;   
    		     if (trim(jbCredentialsCode) == "") {  
    		         document.getElementById("jbCredentialsCodeTip").innerHTML = "<font color='red'>× 证件号码不能为空</font>";  
    		         return false;  
    		     } else if(trim(jbCredentialsCode) != ""){  
    		         if(!reg.test(jbCredentialsCode)){  
    		             document.getElementById("jbCredentialsCodeTip").innerHTML = "<font color='red'>× 请输入合法的证件号码</font>";  
    		             return false;  
    		         }else{  
    		             document.getElementById("jbCredentialsCodeTip").innerHTML = "<font color='#339933'>√ 证件号码输入正确</font>";  
    		             // 向后台发送处理数据  
    		             /* $.ajax({  
    		                 url : "UserAction_checkCredentialsCode.action",// 目标地址  
    		                 data : {jbCredentialsCode : jbCredentialsCode}, // 目标参数  
    		                 type : "POST", // 用POST方式传输  
    		                 dataType : "text", // 数据格式:text  
    		                 success : function(data) {  
    		                     data = parseInt(data, 10);  
    		                     if (data != 0) {  
    		                         $("#jbCredentialsCodeTip").html("<font color='red'>× 该证件号码已经被注册，请重新输入</font>");  
    		                     } else {  
    		                         $("#jbCredentialsCodeTip").html("<font color='#339933'>√ 该证件号码可以注册，输入正确</font>");  
    		                     }  
    		                 }  
    		             });  */ 
    		             return true;  
    		         }  
    		     }  
    		 },
    		// 联系手机(ajax验证手机号码是否已经存在)  
    		 checkjbPhone:function () {  
    		     var jbPhone = document.form1.jbPhone.value;  
    		     var re= /(^1[3|5|7|8][0-9]{9}$)/;  
    		     if (trim(jbPhone) == "") {  
    		         //document.getElementById("jbPhoneTip").innerHTML = "<font color='red'>× 手机号码不能为空</font>";  
    		         return false;  
    		     } else if(trim(jbPhone) != ""){  
    		         if(!re.test(jbPhone)){  
    		             //document.getElementById("jbPhoneTip").innerHTML = "<font color='red'>× 请输入有效的手机号码</font>";  
    		             return false;  
    		         }else{  
    		             //document.getElementById("jbPhoneTip").innerHTML = "<font color='#339933'>√ 手机号码输入正确</font>";  
    		             // 向后台发送处理数据  
    		            /*  $.ajax({  
    		                 url : "UserAction_checkPhone.action",// 目标地址  
    		                 data : {jbPhone : jbPhone}, // 目标参数  
    		                 type : "POST", // 用POST方式传输  
    		                 dataType : "text", // 数据格式:text  
    		                 success : function(data) {  
    		                     data = parseInt(data, 10);  
    		                     if (data != 0) {  
    		                         $("#jbPhoneTip").html("<font color='red'>× 该手机号码已经被注册，请重新输入</font>");  
    		                     } else {  
    		                         $("#jbPhoneTip").html("<font color='#339933'>√ 该手机号码可以注册，输入正确</font>");  
    		                     }  
    		                 }  
    		             });  */ 
    		             return true;  
    		         }  
    		     }  
    		       
    		 }  
     }
     
     $(function(){    	 
    	 page.init();
     })
  </script>


</body>
</html>